<template>
  <div>
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive"></router-view>
  </div>
</template>

<script>
export default {
  name: 'app',
  data () {
    return {
    }
  },
  mounted: function() {
  	_slefThis = this;
    this.$router.replace({
  		path: '/assistantIndex'
  	})
  },
  components:{
  }
}
var _slefThis = this;
document.addEventListener( "plusready", onPlusReady, false );
function onPlusReady() {
        var webview = plus.webview.currentWebview();
        // 注册返回按键事件
        plus.key.addEventListener('backbutton', function() {
            webview.canBack(function(e){
            	if(scan){
            		scan.close();
            	}
            	if(_slefThis.$router){
            			if("/assistantIndex"== _slefThis.$route.fullPath){
		            			plus.nativeUI.confirm( "确认退出?", function(e){
		            				if(e.index==0){
		            					plus.runtime.quit();
		            				}
		                  });
		            	}else{
		            		if(_slefThis.$route.fullPath!="/"){
		            				_slefThis.$router.back(-1);
		            		}
		            	}
            	}
            })

        }, false);
	}
</script>
<style>
</style>
